package com.lj.uc.config;

import org.springframework.beans.factory.config.PropertiesFactoryBean;
import org.springframework.core.io.Resource;

/**
 * Created by gw on 2016/3/3.
 */
public class PropertiesFactoryBeanEx extends PropertiesFactoryBean {

    public PropertiesFactoryBeanEx(){
        super();
    }

    @Override
    public void setLocations(Resource... locations) {
        if(locations == null){
            return;
        }
        for(int i=0; i< locations.length;i++){
            if(locations[i].exists()){
                super.setLocations(locations[i]);
                return;
            }
        }
    }
}
